415b432284d2e9703711c19f4a04f97d6b0aa018,src/test/java/no/cantara/jau/processkill/DuplicateProcessHandlerTest.java,DuplicateProcessHandlerTest,shouldKillExistingProcessWhenExistingProcessIsRunning,#,22

Before Change



    @Test
    public void shouldKillExistingProcessWhenExistingProcessIsRunning() throws IOException, NoSuchFieldException, IllegalAccessException, InterruptedException {
        createDummyProcess();
        createFileAndWriteLine(PID + "");

        boolean processWasKilled = DuplicateProcessHandler.killExistingProcessIfRunning();

After Change


    @Test
    public void shouldKillExistingProcessWhenExistingProcessIsRunning() throws IOException, NoSuchFieldException, IllegalAccessException, InterruptedException {
        DuplicateProcessHandler duplicateProcessHandler = new DuplicateProcessHandler(new ProcessAdapter());
        Process p = createDummyProcess();
        int PID = getPIDFromProcess(p);
        createFileAndWriteLine(PID + "");

        boolean processWasKilled = duplicateProcessHandler.killExistingProcessIfRunning();